package com.jianqiao.delivery.pay.domain.confirmr2p;

import lombok.Data;

/**
 * author: cyx
 * create: 2024/11/25 8:55
 **/
@Data
public class SettlementDetailsEntity {

    private CreditorAccountDetailEntity creditorAccountDetail;

    private Integer settledAmount;

    private String settledAmountCurrency;

    private String settlementSystem;

    private String settlementSystemReferenceId;

    public SettlementDetailsEntity(CreditorAccountDetailEntity creditorAccountDetail, Integer settledAmount, String settledAmountCurrency, String settlementSystem, String settlementSystemReferenceId) {
        this.creditorAccountDetail = creditorAccountDetail;
        this.settledAmount = settledAmount;
        this.settledAmountCurrency = settledAmountCurrency;
        this.settlementSystem = settlementSystem;
        this.settlementSystemReferenceId = settlementSystemReferenceId;
    }

    public static SettlementDetailsEntityBuild builder() {
        return new SettlementDetailsEntityBuild();
    }

    public static class SettlementDetailsEntityBuild{

        private CreditorAccountDetailEntity creditorAccountDetail;
        private Integer settledAmount;

        private String settledAmountCurrency;

        private String settlementSystem;

        private String settlementSystemReferenceId;

        SettlementDetailsEntityBuild() {

        }

        public SettlementDetailsEntityBuild creditorAccountDetailEntity(final CreditorAccountDetailEntity creditorAccountDetail) {
            this.creditorAccountDetail = creditorAccountDetail;
            return this;
        }

        public SettlementDetailsEntityBuild settledAmount(final Integer settledAmount) {
            this.settledAmount = settledAmount;
            return this;
        }

        public SettlementDetailsEntityBuild settledAmountCurrency(final String settledAmountCurrency) {
            this.settledAmountCurrency = settledAmountCurrency;
            return this;
        }

        public SettlementDetailsEntityBuild settlementSystem(final String settlementSystem) {
            this.settlementSystem = settlementSystem;
            return this;
        }

        public SettlementDetailsEntityBuild settlementSystemReferenceId(final String settlementSystemReferenceId) {
            this.settlementSystemReferenceId = settlementSystemReferenceId;
            return this;
        }

        public SettlementDetailsEntity build() {
            return new SettlementDetailsEntity(this.creditorAccountDetail ,
                                               this.settledAmount ,
                                               this.settledAmountCurrency ,
                                               this.settlementSystem ,
                                               this.settlementSystemReferenceId);
        }
    }
}
